import { useSpring } from "lingo3d-vue";
import { computed, ref } from "vue";

export function watching() {
  const watchIn = () => {
    console.log("in");
    looking.value = true;
  };
  const watchOff = () => {
    console.log('off');
    looking.value = false;
  };

  const looking = ref(false);

  const camY = computed(() => {
    if (looking.value) {
      return 200
    } else {
     return 70
    }
  });

  const camZ = computed(() => {
    if (looking.value) {
      return 150
    } else {
     return 250
    }
  });

//   velocity?: number;
//   stiffness?: number;
//   damping?: number;
//   mass?: number;
//   duration?: number;
//   bounce?: number;
//   restSpeed?: number;
//   restDelta?: number;
//   from?: number;
//   to: number | Ref<number>;
//   step?: (value: number) => void;
//   delay?: number;
  console.log(useSpring);
  const camYSpring = useSpring({
    to:camY,
    bounce:0
  });
  const camZSpring = useSpring({
    to:camZ,
    bounce:0
  });

  return {
    watchIn,
    watchOff,
    camYSpring,
    camZSpring,
  };
}
